<template>
  <div class="goods-list">
    <div class="goods-info sa-flex-row sa-row-left sa-col-center" v-for="(item,index) in compData.data.goodsList" :key="index">
        <div class="img-view sa-flex-row sa-row-center sa-col-center" >
          <!-- <img :src="handlerSrc(item)" style="width: 88px;height: 88px;"/> -->
          <sa-preview :url="item.image" size="88"></sa-preview>
        </div>
        <div class="title-price sa-flex-col">
            <div class="goods-title">{{item.title}}</div>
            <div class="right sa-flex-row">
              <div class="money">¥</div>
              <div class="goods-price">{{removeTrailingZeros(item.price[0])}}</div>
            </div>
        </div>
        <img class="submit-img" src="https://xyh-static-app.oss-cn-hangzhou.aliyuncs.com/storage/holiday/20250428/6d5bbab15884b0a9d185f0d585736b9d.png" style="width:40px;height:40px;"/>
    </div>
  </div>
</template>

<script setup>
import { computed,onMounted } from 'vue';

const imgUrl=import.meta.env.SHEEP_IMG_URL
const props = defineProps(['compData']);

function removeTrailingZeros(num) {
    return num.toString().replace(/(\.\d*?)0+$/, '$1').replace(/\.$/, '');
}

onMounted(()=>{
  console.log('props.compData',props.compData.data.marginTop)
})

</script>
<style lang="scss" scoped>
.goods-list{
  position:relative;
  padding:7px 15px 8px 8px;
  position:relative;
  display:flex;
  justify-content:center;
  align-items:center;
  background-color:red;
  height:180px;
  
  
}

.goods-info{
  position:absolute;
  top:44px;
  left:10px;
}

.img-view{
  margin-right:14px;
  width: 123px;
  height: 123px;
  border-radius: 10px 10px 10px 10px;
  background-color:#fff;
}

.goods-img{
  width: 51px;
  height: 52px;
  
}

.title-price{
  color:#fff;
  .goods-title{
    color:#fff;
    height: 44px;
    font-family: OPPOSans;
    font-weight: bold;
    font-size: 18px;
    color: #FFFFFF;
    line-height: 22px;
  }
  .right{
    margin-top:32px;
    .money{
      margin-top:8px;
      font-family: OPPOSans;
      font-weight: normal;
      font-size: 10px;
      color: #FFFFFF;
      line-height: 10px;
    }
    .goods-price{

     
      font-family: Source Han Sans CN;
      font-weight: 800;
      font-size: 36px;
      color: #FFFFFF;
      line-height: 36px;

      padding-left:5px;
      padding-right:5px;

    }
  }

}
.submit-img{
  position:absolute;
  right:16px;
  bottom:6px;
}






</style>
